package test.n00300;


public class Problem00330 {
    public static void main(String[] args) {
        println(new int[]{4, 5, 6, 7, 0, 1, 2}, 0);
        println(new int[]{4, 5, 6, 7, 0, 1, 2}, 0);
    }

    public static void println(int[] nums, int target) {
        Solution ss = new Solution();
        System.out.println(nums + "," + target + "," + ss.search(nums, target));
    }

    private static class Solution {
        /**
         * 搜索旋转排序数组
         *
         * @param nums
         * @param target
         * @return
         */
        public int search(int[] nums, int target) {
            int idx = -1;
            for (int i = 0; i < nums.length; i++) {
                if (nums[i] == target) {
                    idx = i;
                }
            }
            return idx;
        }
    }
}
